<template>
<div class="main">
    <div class="left">
        <div class="top">
             <el-button type="primary" class="el-icon-edit" @click="dianJi()">写信</el-button>
        </div>
        <div class="middle">
            <el-menu :default-openeds="opened" :default-active='value' @select="changeSidebar">
                <el-submenu index="1">
                    <template slot="title">
                        <span>文件夹</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="Inbox"><i class="el-icon-s-goods"></i>收件箱</el-menu-item>
                        <el-menu-item index="Outbox"><i class="el-icon-message"></i>发件箱</el-menu-item>
                        <el-menu-item index="drafts"><i class="el-icon-document"></i>草稿箱</el-menu-item>
                        <el-menu-item index="dustbin"><i class="el-icon-delete-solid"></i>垃圾箱</el-menu-item>
                        <el-menu-item index="recycleBin"><i class="el-icon-delete"></i>回收站</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>    
        </div>
        <div class="bottom">
            <el-menu :default-openeds="opened">
                <el-submenu index="1">
                    <template slot="title">
                        <span>类型</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1"><i class="el-icon-discover"></i>邮件</el-menu-item>
                        <el-menu-item index="1-2"><i class="el-icon-discover"></i>通知</el-menu-item>
                        <el-menu-item index="1-3"><i class="el-icon-discover"></i>公告</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>    
        </div>
    </div>

    <div class="right">
        <router-view></router-view>
    </div>
</div>
</template>
<script>
export default {
// eslint-disable-next-line vue/multi-word-component-names
name:"",
components:{},
data(){
    return {
        value:'Inbox',
        opened: ['1'],
    }
    },
    methods:{
        // 点击写信
        dianJi(){
            this.value='',
            this.$router.push('/home/emailManagement/emailManagementHome/writing')
        },
        // 点击文件夹下的子菜单
        changeSidebar(path) {
            this.$router.push(path);
        }
    }
}
</script>
<style lang="less" scoped>
.main{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.left{
    display: flex;
    flex-direction: column;
    width: 30%;
}
.top .el-button{
    width: 100%;
}
.middle{
    margin: 20px 0;
}
.right{
    width: 68%;
    // height: 100px;
    // background-color: rgb(238, 223, 238);
}
</style>